package com.corona.game;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.math.Vector2;
import com.corona.Game;
import com.corona.game.util.SpriteProxy;
import com.corona.game.util.TextureCache;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;

/* compiled from: Menu.java */
/* loaded from: pokewilds.jar:com/pkmngen/game/DrawPokemonMenu.class */
public class DrawPokemonMenu extends Menu {
    public Action.Layer layer;
    Sprite bgSprite;
    Sprite helperSprite;
    Sprite arrow;
    Sprite arrowWhite;
    Sprite healthBar;
    Sprite healthSprite;
    Vector2 newPos;
    Map<Integer, Vector2> arrowCoords;
    String item;
    ArrayList<String> ableWords;
    boolean isStorageChest;
    public static ArrayList<Pokemon> allPokemon;
    public static Tile storageChestTile;
    Sprite arrowLeft;
    int upTimer;
    int downTimer;
    public boolean refresh;
    char[] levelChars;
    Sprite healthSpriteGreen;
    Sprite healthSpriteYellow;
    Sprite healthSpriteRed;
    public static boolean drawChoosePokemonText = true;
    public static int avatarAnimCounter = 24;
    public static int currIndex = 0;
    public static int lastIndex = 0;
    public static int scrollIndex = 0;
    public static Pokemon.Generation generation = Pokemon.Generation.CRYSTAL;
    public static boolean animsPaused = false;
    public static int avatarHopAnimCounter = 0;
    public static int avatarAnimCounterGen2 = 0;
    public static int avatarYellowHealthAnimCounter = 0;
    public static int avatarRedHealthAnimCounter = 0;

    public DrawPokemonMenu(Game game, boolean isStorageChest, Tile storageChestTile2, Menu prevMenu) {
        this(game, prevMenu);
        this.isStorageChest = isStorageChest;
        storageChestTile = storageChestTile2;
    }

    public DrawPokemonMenu(Game game, String item, Menu prevMenu) {
        this(game, prevMenu);
        this.item = item;
    }

    public DrawPokemonMenu(Game game, Menu prevMenu) {
        this.layer = Action.Layer.gui_108;
        this.item = null;
        this.ableWords = new ArrayList<>();
        this.isStorageChest = false;
        this.upTimer = 0;
        this.downTimer = 0;
        this.refresh = false;
        this.prevMenu = prevMenu;
        this.arrowWhite = new Sprite(TextureCache.get(Gdx.files.internal("battle/arrow_right_white.png")), 0, 0, 5, 7);
        Texture text = TextureCache.get(Gdx.files.internal("battle/arrow_right1.png"));
        this.arrow = new Sprite(text, 0, 0, 5, 7);
        this.arrowLeft = new Sprite(text, 0, 0, 5, 7);
        this.arrowLeft.flip(true, false);
        currIndex = lastIndex;
        this.arrowCoords = new HashMap();
        if (generation == Pokemon.Generation.RED) {
            this.healthBar = new Sprite(TextureCache.get(Gdx.files.internal("menu/health_bar.png")), 0, 0, 160, 16);
            this.healthSprite = new Sprite(TextureCache.get(Gdx.files.internal("battle/health1.png")), 0, 0, 1, 2);
            for (int i = -1; i < 6; i++) {
                this.arrowCoords.put(Integer.valueOf(i), new Vector2(1.0f, (float) (128 - (16 * i))));
            }
            this.bgSprite = new Sprite(TextureCache.get(Gdx.files.internal("battle/battle_bg3.png")), 8, 8, 160, 144);
        } else {
            this.healthBar = new Sprite(TextureCache.get(Gdx.files.internal("menu/gsc/health_bar1.png")), 0, 0, 160, 16);
            this.healthSpriteGreen = new SpriteProxy(new Color(0.9375f, 0.8125f, 0.46875f, 1.0f), TextureCache.get(Gdx.files.internal("battle/gsc/health1.png")), 0, 0, 1, 2);
            this.healthSpriteYellow = new SpriteProxy(new Color(0.9375f, 0.8125f, 0.46875f, 1.0f), TextureCache.get(Gdx.files.internal("battle/gsc/health_yellow.png")), 0, 0, 1, 2);
            this.healthSpriteRed = new SpriteProxy(new Color(0.9375f, 0.8125f, 0.46875f, 1.0f), TextureCache.get(Gdx.files.internal("battle/gsc/health_red.png")), 0, 0, 1, 2);
            for (int i2 = -1; i2 < 6; i2++) {
                this.arrowCoords.put(Integer.valueOf(i2), new Vector2(1.0f, (float) (129 - (16 * i2))));
            }
            this.bgSprite = new Sprite(TextureCache.get(Gdx.files.internal("menu/gsc/background1.png")));
        }
        this.newPos = this.arrowCoords.get(Integer.valueOf(currIndex));
    }

    @Override // com.corona.game.Action
    public String getCamera() {
        return "gui";
    }

    @Override // com.corona.game.Action
    public Action.Layer getLayer() {
        return this.layer;
    }

    public void refreshCursorPosition() {
        if (currIndex < 0) {
            currIndex = 0;
        }
        if (currIndex + scrollIndex >= allPokemon.size()) {
            scrollIndex = allPokemon.size() - 6;
            if (scrollIndex < 0) {
                scrollIndex = 0;
            }
        }
        while (currIndex + scrollIndex >= allPokemon.size()) {
            if (scrollIndex > 0) {
                scrollIndex--;
            } else {
                currIndex--;
            }
        }
    }

    @Override // com.corona.game.Action
    public void firstStep(Game game) {
        if (this.item != null && Game.evoStones.contains(this.item)) {
            this.ableWords.clear();
            Iterator<Pokemon> it = game.player.pokemon.iterator();
            while (it.hasNext()) {
                Pokemon pokemon = it.next();
                if (pokemon.isEgg) {
                    this.ableWords.add("NOT ABLE");
                } else {
                    boolean foundItem = false;
                    for (String evo : Specie.gen2Evos.get(pokemon.specie.name).keySet()) {
                        if (evo.equals(this.item) && (!pokemon.specie.name.equals("snorunt") || pokemon.gender.equals("female"))) {
                            if (!pokemon.specie.name.equals("kirlia") || pokemon.gender.equals("male")) {
                                foundItem = true;
                                break;
                            }
                        }
                    }
                    if (foundItem) {
                        this.ableWords.add("ABLE");
                    } else {
                        this.ableWords.add("NOT ABLE");
                    }
                }
            }
        }
        allPokemon = game.player.pokemon;
        refreshCursorPosition();
        avatarHopAnimCounter = 0;
        avatarAnimCounterGen2 = 0;
    }

    public void stepGen1(Game game) {
        char[] textArray;
        game.uiBatch.draw(this.bgSprite, this.bgSprite.getX(), this.bgSprite.getY());
        int i = 0;
        while (i + scrollIndex < allPokemon.size() && i < 6) {
            Pokemon currPokemon = allPokemon.get(i + scrollIndex);
            if (i != currIndex) {
                game.uiBatch.draw(currPokemon.avatarSprites.get(0), 8.0f, (float) (128 - (16 * i)));
            } else if (avatarAnimCounter >= 18) {
                game.uiBatch.draw(currPokemon.avatarSprites.get(0), 8.0f, (float) (128 - (16 * i)));
            } else if (avatarAnimCounter >= 12) {
                game.uiBatch.draw(currPokemon.avatarSprites.get(1), 8.0f, (float) (128 - (16 * i)));
            } else if (avatarAnimCounter >= 6) {
                game.uiBatch.draw(currPokemon.avatarSprites.get(2), 8.0f, (float) (128 - (16 * i)));
            } else {
                game.uiBatch.draw(currPokemon.avatarSprites.get(3), 8.0f, (float) (128 - (16 * i)));
            }
            if (i < this.ableWords.size()) {
                textArray = this.ableWords.get(i).toUpperCase(Locale.ROOT).toCharArray();
            } else {
                textArray = currPokemon.nickname.toUpperCase(Locale.ROOT).toCharArray();
            }
            for (int j = 0; j < textArray.length; j++) {
                game.uiBatch.draw(game.textDict.get(Character.valueOf(textArray[j])), (float) (24 + (8 * j)), (float) (136 - (16 * i)));
            }
            if (!currPokemon.isEgg) {
                game.uiBatch.draw(this.healthBar, 0.0f, (float) (128 - (16 * i)));
                if (currPokemon.status == null || currPokemon.status.equals("confuse") || currPokemon.status.equals("attract")) {
                    this.levelChars = String.valueOf(currPokemon.level).toCharArray();
                    int offset = -8 * (currPokemon.level / 100);
                    for (char c : this.levelChars) {
                        game.uiBatch.draw(game.textDict.get(Character.valueOf(c)), (float) (112 + offset), (float) (136 - (16 * i)));
                        offset += 8;
                    }
                } else {
                    String text = "";
                    if (currPokemon.status.equals("poison") || currPokemon.status.equals("toxic")) {
                        text = "PSN";
                    } else if (currPokemon.status.equals("paralyze")) {
                        text = "PAR";
                    } else if (currPokemon.status.equals("freeze")) {
                        text = "FRZ";
                    } else if (currPokemon.status.equals("sleep")) {
                        text = "SLP";
                    } else if (currPokemon.status.equals("burn")) {
                        text = "BRN";
                    }
                    char[] textArray2 = text.toCharArray();
                    for (int j2 = 0; j2 < textArray2.length; j2++) {
                        game.uiBatch.draw(game.textDict.get(Character.valueOf(textArray2[j2])), (float) (104 + (8 * j2)), (float) (136 - (16 * i)));
                    }
                }
                char[] textArray3 = String.valueOf(currPokemon.maxStats.get("hp")).toCharArray();
                int offset2 = -8 * (textArray3.length - 1);
                for (char c2 : textArray3) {
                    game.uiBatch.draw(game.textDict.get(Character.valueOf(c2)), (float) (152 + offset2), (float) (128 - (16 * i)));
                    offset2 += 8;
                }
                char[] textArray4 = String.valueOf(currPokemon.currentStats.get("hp")).toCharArray();
                int offset3 = -8 * (textArray4.length - 1);
                for (char c3 : textArray4) {
                    game.uiBatch.draw(game.textDict.get(Character.valueOf(c3)), (float) (120 + offset3), (float) (128 - (16 * i)));
                    offset3 += 8;
                }
                int targetSize = (int) Math.ceil((double) ((((float) currPokemon.currentStats.get("hp").intValue()) * 48.0f) / ((float) currPokemon.maxStats.get("hp").intValue())));
                for (int j3 = 0; j3 < targetSize; j3++) {
                    game.uiBatch.draw(this.healthSprite, (float) (48 + (1 * j3)), (float) (131 - (16 * i)));
                }
                if (currPokemon.gender.equals("male")) {
                    game.uiBatch.draw(TextureCache.maleSymbol, 136.0f, (float) (136 - (16 * i)));
                } else if (currPokemon.gender.equals("female")) {
                    game.uiBatch.draw(TextureCache.femaleSymbol, 136.0f, (float) (136 - (16 * i)));
                }
            }
            i++;
        }
        if (this.isStorageChest) {
            if (allPokemon == game.player.pokemon) {
                char[] textArray5 = "Your POKéMON".toCharArray();
                for (int l = 0; l < textArray5.length; l++) {
                    game.uiBatch.draw(game.textDict.get(Character.valueOf(textArray5[l])), (float) (32 + (8 * l)), 24.0f);
                }
                game.uiBatch.draw(this.arrow, 136.0f, 24.0f);
                return;
            }
            char[] textArray6 = "Stored POKéMON".toCharArray();
            for (int l2 = 0; l2 < textArray6.length; l2++) {
                game.uiBatch.draw(game.textDict.get(Character.valueOf(textArray6[l2])), (float) (24 + (8 * l2)), 24.0f);
            }
            game.uiBatch.draw(this.arrowLeft, 8.0f, 24.0f);
        } else if (drawChoosePokemonText) {
            char[] textArray7 = "Choose a POKéMON.".toCharArray();
            for (int j4 = 0; j4 < textArray7.length; j4++) {
                game.uiBatch.draw(game.textDict.get(Character.valueOf(textArray7[j4])), (float) (8 + (8 * j4)), 24.0f);
            }
        }
    }

    public void stepGen2(Game game) {
        char[] textArray;
        game.uiBatch.draw(this.bgSprite, 0.0f, 0.0f);
        int i = 0;
        while (i + scrollIndex < allPokemon.size() && i < 6) {
            Pokemon currPokemon = allPokemon.get(i + scrollIndex);
            if (i < this.ableWords.size()) {
                textArray = this.ableWords.get(i).toUpperCase(Locale.ROOT).toCharArray();
            } else {
                textArray = currPokemon.nickname.toUpperCase(Locale.ROOT).toCharArray();
            }
            for (int j = 0; j < textArray.length; j++) {
                game.uiBatch.draw(game.textDict.get(Character.valueOf(textArray[j])), (float) (24 + (8 * j)), (float) (128 - (16 * i)));
            }
            int targetSize = (int) Math.ceil((double) ((((float) currPokemon.currentStats.get("hp").intValue()) * 48.0f) / ((float) currPokemon.maxStats.get("hp").intValue())));
            int offset = 0;
            int offsetY = 0;
            int interval = 9;
            int counter = avatarAnimCounterGen2;
            if (i == currIndex || i == SelectedMenu.Switch.index) {
                offset = 8;
                if (avatarHopAnimCounter >= 16 && !currPokemon.isEgg) {
                    offsetY = 1;
                }
            }
            if (targetSize > 23) {
                this.healthSprite = this.healthSpriteGreen;
            } else if (targetSize > 10) {
                interval = 73;
                counter = avatarYellowHealthAnimCounter;
                this.healthSprite = this.healthSpriteYellow;
            } else {
                interval = 138;
                counter = avatarRedHealthAnimCounter;
                offsetY = 0;
                this.healthSprite = this.healthSpriteRed;
            }
            if (counter >= interval * 3) {
                game.uiBatch.draw(currPokemon.avatarSprites.get(0), (float) offset, (float) ((126 - (16 * i)) + offsetY));
            } else if (counter >= interval * 2) {
                game.uiBatch.draw(currPokemon.avatarSprites.get(1), (float) offset, (float) ((126 - (16 * i)) + offsetY));
            } else if (counter >= interval * 1) {
                game.uiBatch.draw(currPokemon.avatarSprites.get(2), (float) offset, (float) ((126 - (16 * i)) + offsetY));
            } else {
                game.uiBatch.draw(currPokemon.avatarSprites.get(3), (float) offset, (float) ((126 - (16 * i)) + offsetY));
            }
            if (!currPokemon.isEgg) {
                for (int j2 = 0; j2 < targetSize; j2++) {
                    game.uiBatch.draw(this.healthSprite, (float) (104 + (1 * j2)), (float) (123 - (16 * i)));
                }
                game.uiBatch.draw(this.healthBar, 0.0f, (float) (120 - (16 * i)));
                this.levelChars = String.valueOf(currPokemon.level).toCharArray();
                int offset2 = -8 * (currPokemon.level / 100);
                for (char c : this.levelChars) {
                    game.uiBatch.draw(game.textDict.get(Character.valueOf(c)), (float) (72 + offset2), (float) (120 - (16 * i)));
                    offset2 += 8;
                }
                String text = "";
                if (currPokemon.status != null) {
                    if (currPokemon.status.equals("poison") || currPokemon.status.equals("toxic")) {
                        text = "PSN";
                    } else if (currPokemon.status.equals("paralyze")) {
                        text = "PAR";
                    } else if (currPokemon.status.equals("freeze")) {
                        text = "FRZ";
                    } else if (currPokemon.status.equals("sleep")) {
                        text = "SLP";
                    } else if (currPokemon.status.equals("burn")) {
                        text = "BRN";
                    }
                }
                if (currPokemon.currentStats.get("hp").intValue() <= 0) {
                    text = "FNT";
                }
                char[] textArray2 = text.toCharArray();
                for (int j3 = 0; j3 < textArray2.length; j3++) {
                    game.uiBatch.draw(game.textDict.get(Character.valueOf(textArray2[j3])), (float) (40 + (8 * j3)), (float) (120 - (16 * i)));
                }
                char[] textArray3 = String.valueOf(currPokemon.maxStats.get("hp")).toCharArray();
                int offset3 = -8 * (textArray3.length - 1);
                for (char c2 : textArray3) {
                    game.uiBatch.draw(game.textDict.get(Character.valueOf(c2)), (float) (152 + offset3), (float) (128 - (16 * i)));
                    offset3 += 8;
                }
                char[] textArray4 = String.valueOf(currPokemon.currentStats.get("hp")).toCharArray();
                int offset4 = -8 * (textArray4.length - 1);
                for (char c3 : textArray4) {
                    game.uiBatch.draw(game.textDict.get(Character.valueOf(c3)), (float) (120 + offset4), (float) (128 - (16 * i)));
                    offset4 += 8;
                }
                if (currPokemon.gender.equals("male")) {
                    game.uiBatch.draw(TextureCache.maleSymbol, 24.0f, (float) (120 - (16 * i)));
                } else if (currPokemon.gender.equals("female")) {
                    game.uiBatch.draw(TextureCache.femaleSymbol, 24.0f, (float) (120 - (16 * i)));
                }
            }
            i++;
        }
        if (this.isStorageChest) {
            if (allPokemon == game.player.pokemon) {
                char[] textArray5 = "Your POKéMON".toCharArray();
                for (int l = 0; l < textArray5.length; l++) {
                    game.uiBatch.draw(game.textDict.get(Character.valueOf(textArray5[l])), (float) (32 + (8 * l)), 8.0f);
                }
                game.uiBatch.draw(this.arrow, 136.0f, 8.0f);
                return;
            }
            char[] textArray6 = "Stored POKéMON".toCharArray();
            for (int l2 = 0; l2 < textArray6.length; l2++) {
                game.uiBatch.draw(game.textDict.get(Character.valueOf(textArray6[l2])), (float) (24 + (8 * l2)), 8.0f);
            }
            game.uiBatch.draw(this.arrowLeft, 8.0f, 8.0f);
        } else if (drawChoosePokemonText) {
            char[] textArray7 = "Choose a POKéMON.".toCharArray();
            for (int j4 = 0; j4 < textArray7.length; j4++) {
                game.uiBatch.draw(game.textDict.get(Character.valueOf(textArray7[j4])), (float) (8 + (8 * j4)), 8.0f);
            }
        }
    }

    @Override // com.corona.game.Action
    public void step(Game game) {
        String text;
        if (this.prevMenu != null) {
            this.prevMenu.step(game);
        }
        if (generation == Pokemon.Generation.RED) {
            stepGen1(game);
        } else {
            stepGen2(game);
        }
        if (this.drawArrowWhite) {
            game.uiBatch.draw(this.arrowWhite, this.newPos.x, this.newPos.y);
        }
        if (this.goAway) {
            game.actionStack.remove(this);
            return;
        }
        if (!animsPaused) {
            avatarHopAnimCounter++;
            if (avatarHopAnimCounter >= 32) {
                avatarHopAnimCounter = 0;
            }
            avatarAnimCounterGen2++;
            if (avatarAnimCounterGen2 >= 36) {
                avatarAnimCounterGen2 = 0;
            }
            avatarYellowHealthAnimCounter++;
            if (avatarYellowHealthAnimCounter >= 304) {
                avatarYellowHealthAnimCounter = 0;
            }
            avatarRedHealthAnimCounter++;
            if (avatarRedHealthAnimCounter >= 552) {
                avatarRedHealthAnimCounter = 0;
            }
        }
        if (!this.disabled) {
            if (this.refresh) {
                refreshCursorPosition();
            }
            avatarAnimCounter--;
            if (avatarAnimCounter <= 0) {
                avatarAnimCounter = 23;
            }
            if (this.isStorageChest) {
                if (InputProcessor.rightJustPressed && allPokemon == game.player.pokemon) {
                    allPokemon = storageChestTile.routeBelongsTo.storedPokemon;
                    refreshCursorPosition();
                    game.actionStack.remove(this);
                    game.insertAction(new DrawWhiteScreen(30, this));
                    game.insertAction(new PlayMusic("menu_switch2", (Action) null));
                    return;
                } else if (InputProcessor.leftJustPressed && allPokemon != game.player.pokemon) {
                    allPokemon = game.player.pokemon;
                    refreshCursorPosition();
                    game.actionStack.remove(this);
                    game.insertAction(new DrawWhiteScreen(30, this));
                    game.insertAction(new PlayMusic("menu_switch2", (Action) null));
                    return;
                }
            }
            if (InputProcessor.upPressed) {
                if (this.upTimer < 20) {
                    this.upTimer++;
                }
            } else if (!InputProcessor.downPressed) {
                this.upTimer = 0;
                this.downTimer = 0;
            } else if (this.downTimer < 20) {
                this.downTimer++;
            }
            if (InputProcessor.upJustPressed || this.upTimer >= 20) {
                if (currIndex + scrollIndex > 0) {
                    if (currIndex > 0) {
                        currIndex--;
                    } else {
                        scrollIndex--;
                    }
                    avatarAnimCounter = 24;
                }
            } else if ((InputProcessor.downJustPressed || this.downTimer >= 20) && currIndex + scrollIndex < allPokemon.size() - 1) {
                if (currIndex < 5) {
                    currIndex++;
                } else {
                    scrollIndex++;
                }
                avatarAnimCounter = 24;
            }
            this.newPos = this.arrowCoords.get(Integer.valueOf(currIndex));
            game.uiBatch.draw(this.arrow, this.newPos.x, this.newPos.y);
            if (InputProcessor.aJustPressed && currIndex >= 0) {
                game.insertAction(new PlayMusic("click1", (Action) null));
                this.disabled = true;
                this.drawArrowWhite = true;
                Pokemon currPokemon = allPokemon.get(currIndex + scrollIndex);
                if (this.item == null) {
                    this.refresh = true;
                    if (generation == Pokemon.Generation.RED) {
                        game.actionStack.remove(this);
                        game.insertAction(new SelectedMenu(this, currPokemon, this.isStorageChest));
                        return;
                    }
                    animsPaused = true;
                    game.insertAction(new WaitFrames(game, 8, new RunCode(()
                    /*  JADX ERROR: Method code generation error
                        jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x0b8c: INVOKE
                          (r106v0 'game' com.corona.Game A[D('game' com.corona.Game)])
                          (wrap: com.corona.game.WaitFrames : 0x0b89: CONSTRUCTOR  (r1v21 com.corona.game.WaitFrames A[REMOVE]) =
                          (r106v0 'game' com.corona.Game A[D('game' com.corona.Game)])
                          (8 int)
                          (wrap: com.corona.game.RunCode : 0x0b86: CONSTRUCTOR  (r5v2 com.corona.game.RunCode A[REMOVE]) =
                          (wrap: java.lang.Runnable : 0x0b74: INVOKE_CUSTOM (r7v4 java.lang.Runnable A[REMOVE]) =
                          (r105v0 'this' com.corona.game.DrawPokemonMenu A[D('this' com.corona.game.DrawPokemonMenu), DONT_INLINE, IMMUTABLE_TYPE, THIS])
                          (r106v0 'game' com.corona.Game A[D('game' com.corona.Game), DONT_INLINE])

                         handle type: INVOKE_DIRECT
                         lambda: java.lang.Runnable.run():void
                         call insn: ?: INVOKE  (r7 I:com.corona.game.DrawPokemonMenu), (r8 I:com.corona.Game) type: DIRECT call: com.corona.game.DrawPokemonMenu.lambda$step$1(com.corona.Game):void)
                          (wrap: com.corona.game.DrawPokemonMenu$SelectedMenu : 0x0b83: CONSTRUCTOR  (r8v2 com.corona.game.DrawPokemonMenu$SelectedMenu A[REMOVE]) =
                          (r105v0 'this' com.corona.game.DrawPokemonMenu A[D('this' com.corona.game.DrawPokemonMenu), IMMUTABLE_TYPE, THIS])
                          (r0v47 'currPokemon' com.corona.game.Pokemon A[D('currPokemon' com.corona.game.Pokemon)])
                          (wrap: boolean : 0x0b80: IGET  (r12v10 boolean A[REMOVE]) = (r105v0 'this' com.corona.game.DrawPokemonMenu A[D('this' com.corona.game.DrawPokemonMenu), IMMUTABLE_TYPE, THIS]) com.corona.game.DrawPokemonMenu.isStorageChest boolean)
                         call: com.corona.game.DrawPokemonMenu.SelectedMenu.<init>(com.corona.game.Menu, com.corona.game.Pokemon, boolean):void type: CONSTRUCTOR)
                         call: com.corona.game.RunCode.<init>(java.lang.Runnable, com.corona.game.Action):void type: CONSTRUCTOR)
                         call: com.corona.game.WaitFrames.<init>(com.corona.Game, int, com.corona.game.Action):void type: CONSTRUCTOR)
                         type: VIRTUAL call: com.corona.Game.insertAction(com.corona.game.Action):void in method: com.corona.game.DrawPokemonMenu.step(com.corona.Game):void, file: pokewilds.jar:com/pkmngen/game/DrawPokemonMenu.class
                        	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:285)
                        	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:248)
                        	at jadx.core.codegen.RegionGen.makeSimpleBlock(RegionGen.java:105)
                        	at jadx.core.dex.nodes.IBlock.generate(IBlock.java:15)
                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                        	at jadx.core.dex.regions.Region.generate(Region.java:35)
                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                        	at jadx.core.dex.regions.Region.generate(Region.java:35)
                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                        	at jadx.core.dex.regions.Region.generate(Region.java:35)
                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                        	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:94)
                        	at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:137)
                        	at jadx.core.dex.regions.conditions.IfRegion.generate(IfRegion.java:137)
                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                        	at jadx.core.dex.regions.Region.generate(Region.java:35)
                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                        	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:94)
                        	at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:137)
                        	at jadx.core.dex.regions.conditions.IfRegion.generate(IfRegion.java:137)
                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                        	at jadx.core.dex.regions.Region.generate(Region.java:35)
                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                        	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:94)
                        	at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:137)
                        	at jadx.core.dex.regions.conditions.IfRegion.generate(IfRegion.java:137)
                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                        	at jadx.core.dex.regions.Region.generate(Region.java:35)
                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                        	at jadx.core.dex.regions.Region.generate(Region.java:35)
                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                        	at jadx.core.dex.regions.Region.generate(Region.java:35)
                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                        	at jadx.core.codegen.MethodGen.addRegionInsns(MethodGen.java:261)
                        	at jadx.core.codegen.MethodGen.addInstructions(MethodGen.java:254)
                        	at jadx.core.codegen.ClassGen.addMethodCode(ClassGen.java:349)
                        	at jadx.core.codegen.ClassGen.addMethod(ClassGen.java:302)
                        	at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$2(ClassGen.java:271)
                        	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
                        	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
                        	at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
                        	at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:261)
                        Caused by: java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1
                        	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)
                        	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
                        	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
                        	at java.base/java.util.Objects.checkIndex(Objects.java:385)
                        	at java.base/java.util.ArrayList.get(ArrayList.java:427)
                        	at jadx.core.codegen.InsnGen.makeInlinedLambdaMethod(InsnGen.java:909)
                        	at jadx.core.codegen.InsnGen.makeInvokeLambda(InsnGen.java:814)
                        	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:756)
                        	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:397)
                        	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:141)
                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:120)
                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                        	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:976)
                        	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:711)
                        	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:393)
                        	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:141)
                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:120)
                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                        	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:976)
                        	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:711)
                        	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:393)
                        	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:141)
                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:120)
                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                        	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:976)
                        	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:801)
                        	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:397)
                        	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:278)
                        	... 41 more
                        */
                    /*
                    // Method dump skipped, instructions count: 3138
                    */
                    throw new UnsupportedOperationException("Method not decompiled: com.corona.game.DrawPokemonMenu.step(com.corona.Game):void");
                }

                /* compiled from: Menu.java */
                /* loaded from: pokewilds.jar:com/pkmngen/game/DrawPokemonMenu$Intro.class */
                public static class Intro extends Action {
                    public Action.Layer layer;
                    int duration;
                    Sprite bgSprite;

                    public Intro(Action nextAction) {
                        super(new Object[0]);
                        this.layer = Action.Layer.gui_110;
                        this.duration = 18;
                        this.nextAction = nextAction;
                        this.bgSprite = new Sprite(TextureCache.get(Gdx.files.internal("battle/intro_frame6.png")), 0, 0, 160, 144);
                    }

                    public Intro(int duration, Action nextAction) {
                        this(nextAction);
                        this.duration = duration;
                    }

                    @Override // com.corona.game.Action
                    public String getCamera() {
                        return "gui";
                    }

                    @Override // com.corona.game.Action
                    public Action.Layer getLayer() {
                        return this.layer;
                    }

                    @Override // com.corona.game.Action
                    public void step(Game game) {
                        this.bgSprite.draw(game.uiBatch);
                        this.duration--;
                        if (this.duration <= 0) {
                            game.insertAction(this.nextAction);
                            game.actionStack.remove(this);
                        }
                    }
                }

                /* compiled from: Menu.java */
                /* loaded from: pokewilds.jar:com/pkmngen/game/DrawPokemonMenu$Outro.class */
                public static class Outro extends Action {
                    Menu prevMenu;
                    public Action.Layer layer;
                    int duration;
                    Sprite bgSprite;

                    public Outro(Action nextAction) {
                        this((Menu) null);
                        this.nextAction = nextAction;
                    }

                    public Outro(Menu prevMenu) {
                        super(new Object[0]);
                        this.layer = Action.Layer.gui_110;
                        this.duration = 34;
                        this.prevMenu = prevMenu;
                        if (this.prevMenu != null) {
                            this.prevMenu.drawArrowWhite = true;
                        }
                        this.bgSprite = new Sprite(TextureCache.get(Gdx.files.internal("battle/intro_frame6.png")), 0, 0, 160, 144);
                    }

                    @Override // com.corona.game.Action
                    public String getCamera() {
                        return "gui";
                    }

                    @Override // com.corona.game.Action
                    public Action.Layer getLayer() {
                        return this.layer;
                    }

                    @Override // com.corona.game.Action
                    public void step(Game game) {
                        if (this.prevMenu != null) {
                            this.prevMenu.step(game);
                        }
                        this.duration--;
                        if (this.duration > 0) {
                            this.bgSprite.draw(game.uiBatch);
                        }
                        if (this.duration <= 0) {
                            if (this.prevMenu != null) {
                                game.insertAction(this.prevMenu);
                                this.prevMenu.disabled = false;
                                this.prevMenu.drawArrowWhite = false;
                            }
                            game.insertAction(this.nextAction);
                            game.actionStack.remove(this);
                        }
                    }
                }

                /* compiled from: Menu.java */
                /* loaded from: pokewilds.jar:com/pkmngen/game/DrawPokemonMenu$SelectedMenu.class */
                static class SelectedMenu extends Menu {
                    Sprite arrow;
                    Sprite textBoxTop;
                    Sprite textBoxMiddle;
                    Sprite textBoxBottom;
                    Pokemon pokemon;
                    public Action.Layer layer;
                    Map<Integer, Vector2> getCoords;
                    int curr;
                    Vector2 newPos;
                    ArrayList<String> words;
                    int textboxDelay;
                    boolean isStorageChest;

                    public SelectedMenu(Menu prevMenu, Pokemon pokemon) {
                        this(prevMenu, pokemon, false);
                    }

                    public SelectedMenu(Menu prevMenu, Pokemon pokemon, boolean isStorageChest) {
                        this.layer = Action.Layer.gui_105;
                        this.getCoords = new HashMap();
                        this.words = new ArrayList<>();
                        this.textboxDelay = 0;
                        this.isStorageChest = false;
                        this.prevMenu = prevMenu;
                        this.pokemon = pokemon;
                        this.isStorageChest = isStorageChest;
                        this.arrow = new Sprite(TextureCache.get(Gdx.files.internal("battle/arrow_right1.png")), 0, 0, 5, 7);
                        this.textBoxTop = new Sprite(TextureCache.get(Gdx.files.internal("menu/gsc/selected_menu_top.png")), 0, 0, 112, 24);
                        this.textBoxMiddle = new Sprite(TextureCache.get(Gdx.files.internal("menu/gsc/selected_menu_middle.png")), 0, 0, 112, 16);
                        this.textBoxBottom = new Sprite(TextureCache.get(Gdx.files.internal("menu/gsc/selected_menu_bottom.png")), 0, 0, 112, 24);
                    }

                    public void swapPokemon(Game game, Pokemon pokemon, boolean toParty) {
                        if (toParty) {
                            game.player.pokemon.add(pokemon);
                            DrawPokemonMenu.storageChestTile.routeBelongsTo.storedPokemon.remove(pokemon);
                            return;
                        }
                        DrawPokemonMenu.storageChestTile.routeBelongsTo.storedPokemon.add(pokemon);
                        game.player.pokemon.remove(pokemon);
                    }

                    public void releasePokemon(Game game, Pokemon pokemon, boolean inParty) {
                        if (inParty) {
                            game.player.pokemon.remove(pokemon);
                        } else {
                            DrawPokemonMenu.storageChestTile.routeBelongsTo.storedPokemon.remove(pokemon);
                        }
                    }

                    public Action getAction(Game game, String word, Menu prevMenu) {
                        if (word.equals("STORE") || word.equals("TAKE")) {
                            if (DrawPokemonMenu.allPokemon == game.player.pokemon) {
                                Pokemon pokemon = DrawPokemonMenu.allPokemon.get(DrawPokemonMenu.currIndex + DrawPokemonMenu.scrollIndex);
                                boolean hasOneHealthyPokemon = false;
                                Iterator<Pokemon> it = game.player.pokemon.iterator();
                                while (true) {
                                    if (!it.hasNext()) {
                                        break;
                                    }
                                    Pokemon otherPokemon = it.next();
                                    if (pokemon != otherPokemon && otherPokemon.currentStats.get("hp").intValue() > 0 && !otherPokemon.isEgg) {
                                        hasOneHealthyPokemon = true;
                                        break;
                                    }
                                }
                                if (!hasOneHealthyPokemon) {
                                    this.disabled = true;
                                    game.insertAction(this.prevMenu);
                                    return new PlayMusic("error1", new DisplayText(game, "You need at least 1 POKéMON in your party.", (String) null, (Action) null, new SetField(this.prevMenu, "disabled", false, null)));
                                } else if (game.player.hmPokemon != pokemon || !game.player.currFieldMove.equals("SURF")) {
                                    game.insertAction(this.prevMenu);
                                    return new DisplayText(game, "Move to storage?", (String) null, true, false, (Action) new DrawYesNoMenu(null, new DisplayText.Clear(game, new WaitFrames(game, 3, new PlayMusic("ball_switch1", new RunCode(()
                                    /*  JADX ERROR: Method code generation error
                                        jadx.core.utils.exceptions.CodegenException: Error generate insn: 0x017b: RETURN
                                          (wrap: com.corona.game.DisplayText : 0x0178: CONSTRUCTOR  (r0v30 com.corona.game.DisplayText A[REMOVE]) =
                                          (r34v0 'game' com.corona.Game A[D('game' com.corona.Game)])
                                          ("Move to storage?")
                                          (wrap: java.lang.String : ?: CAST (java.lang.String) (null java.lang.String))
                                          true
                                          false
                                          (wrap: com.corona.game.Action : ?: CAST (com.corona.game.Action) (wrap: com.corona.game.DrawYesNoMenu : 0x0175: CONSTRUCTOR  (r7v2 com.corona.game.DrawYesNoMenu A[REMOVE]) =
                                          (null com.corona.game.Menu)
                                          (wrap: com.corona.game.DisplayText$Clear : 0x014f: CONSTRUCTOR  (r10v2 com.corona.game.DisplayText$Clear A[REMOVE]) =
                                          (r34v0 'game' com.corona.Game A[D('game' com.corona.Game)])
                                          (wrap: com.corona.game.WaitFrames : 0x014c: CONSTRUCTOR  (r13v4 com.corona.game.WaitFrames A[REMOVE]) =
                                          (r34v0 'game' com.corona.Game A[D('game' com.corona.Game)])
                                          (3 int)
                                          (wrap: com.corona.game.PlayMusic : 0x0149: CONSTRUCTOR  (r17v2 com.corona.game.PlayMusic A[REMOVE]) =
                                          ("ball_switch1")
                                          (wrap: com.corona.game.RunCode : 0x0146: CONSTRUCTOR  (r20v3 com.corona.game.RunCode A[REMOVE]) =
                                          (wrap: java.lang.Runnable : 0x0140: INVOKE_CUSTOM (r22v4 java.lang.Runnable A[REMOVE]) =
                                          (r33v0 'this' com.corona.game.DrawPokemonMenu$SelectedMenu A[D('this' com.corona.game.DrawPokemonMenu$SelectedMenu), DONT_INLINE, IMMUTABLE_TYPE, THIS])
                                          (r34v0 'game' com.corona.Game A[D('game' com.corona.Game), DONT_INLINE])
                                          (r0v17 'pokemon' com.corona.game.Pokemon A[D('pokemon' com.corona.game.Pokemon), DONT_INLINE])

                                         handle type: INVOKE_DIRECT
                                         lambda: java.lang.Runnable.run():void
                                         call insn: ?: INVOKE  (r22 I:com.corona.game.DrawPokemonMenu$SelectedMenu), (r23 I:com.corona.Game), (r24 I:com.corona.game.Pokemon) type: DIRECT call: com.corona.game.DrawPokemonMenu.SelectedMenu.lambda$getAction$0(com.corona.Game, com.corona.game.Pokemon):void)
                                          (null com.corona.game.Action)
                                         call: com.corona.game.RunCode.<init>(java.lang.Runnable, com.corona.game.Action):void type: CONSTRUCTOR)
                                         call: com.corona.game.PlayMusic.<init>(java.lang.String, com.corona.game.Action):void type: CONSTRUCTOR)
                                         call: com.corona.game.WaitFrames.<init>(com.corona.Game, int, com.corona.game.Action):void type: CONSTRUCTOR)
                                         call: com.corona.game.DisplayText.Clear.<init>(com.corona.Game, com.corona.game.Action):void type: CONSTRUCTOR)
                                          (wrap: com.corona.game.DisplayText$Clear : 0x0172: CONSTRUCTOR  (r11v5 com.corona.game.DisplayText$Clear A[REMOVE]) =
                                          (r34v0 'game' com.corona.Game A[D('game' com.corona.Game)])
                                          (wrap: com.corona.game.WaitFrames : 0x016f: CONSTRUCTOR  (r14v4 com.corona.game.WaitFrames A[REMOVE]) =
                                          (r34v0 'game' com.corona.Game A[D('game' com.corona.Game)])
                                          (3 int)
                                          (wrap: com.corona.game.SetField : 0x016c: CONSTRUCTOR  (r18v3 com.corona.game.SetField A[REMOVE]) =
                                          (wrap: com.corona.game.Menu : 0x0162: IGET  (r20v5 com.corona.game.Menu A[REMOVE]) =
                                          (r33v0 'this' com.corona.game.DrawPokemonMenu$SelectedMenu A[D('this' com.corona.game.DrawPokemonMenu$SelectedMenu), IMMUTABLE_TYPE, THIS])
                                         com.corona.game.DrawPokemonMenu.SelectedMenu.prevMenu com.corona.game.Menu)
                                          ("disabled")
                                          false
                                          (null com.corona.game.Action)
                                         call: com.corona.game.SetField.<init>(java.lang.Object, java.lang.String, java.lang.Object, com.corona.game.Action):void type: CONSTRUCTOR)
                                         call: com.corona.game.WaitFrames.<init>(com.corona.Game, int, com.corona.game.Action):void type: CONSTRUCTOR)
                                         call: com.corona.game.DisplayText.Clear.<init>(com.corona.Game, com.corona.game.Action):void type: CONSTRUCTOR)
                                         call: com.corona.game.DrawYesNoMenu.<init>(com.corona.game.Menu, com.corona.game.Action, com.corona.game.Action):void type: CONSTRUCTOR))
                                         call: com.corona.game.DisplayText.<init>(com.corona.Game, java.lang.String, java.lang.String, boolean, boolean, com.corona.game.Action):void type: CONSTRUCTOR)
                                         in method: com.corona.game.DrawPokemonMenu.SelectedMenu.getAction(com.corona.Game, java.lang.String, com.corona.game.Menu):com.corona.game.Action, file: pokewilds.jar:com/pkmngen/game/DrawPokemonMenu$SelectedMenu.class
                                        	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:285)
                                        	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:248)
                                        	at jadx.core.codegen.RegionGen.makeSimpleBlock(RegionGen.java:105)
                                        	at jadx.core.dex.nodes.IBlock.generate(IBlock.java:15)
                                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                                        	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                                        	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:94)
                                        	at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:137)
                                        	at jadx.core.codegen.RegionGen.connectElseIf(RegionGen.java:170)
                                        	at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:147)
                                        	at jadx.core.dex.regions.conditions.IfRegion.generate(IfRegion.java:137)
                                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                                        	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                                        	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:94)
                                        	at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:137)
                                        	at jadx.core.dex.regions.conditions.IfRegion.generate(IfRegion.java:137)
                                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                                        	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                                        	at jadx.core.codegen.RegionGen.makeRegionIndent(RegionGen.java:94)
                                        	at jadx.core.codegen.RegionGen.makeIf(RegionGen.java:137)
                                        	at jadx.core.dex.regions.conditions.IfRegion.generate(IfRegion.java:137)
                                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                                        	at jadx.core.dex.regions.Region.generate(Region.java:35)
                                        	at jadx.core.codegen.RegionGen.makeRegion(RegionGen.java:65)
                                        	at jadx.core.codegen.MethodGen.addRegionInsns(MethodGen.java:261)
                                        	at jadx.core.codegen.MethodGen.addInstructions(MethodGen.java:254)
                                        	at jadx.core.codegen.ClassGen.addMethodCode(ClassGen.java:349)
                                        	at jadx.core.codegen.ClassGen.addMethod(ClassGen.java:302)
                                        	at jadx.core.codegen.ClassGen.lambda$addInnerClsAndMethods$2(ClassGen.java:271)
                                        	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
                                        	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
                                        	at java.base/java.util.stream.SortedOps$RefSortingSink.end(SortedOps.java:395)
                                        	at java.base/java.util.stream.Sink$ChainedReference.end(Sink.java:261)
                                        Caused by: java.lang.IndexOutOfBoundsException: Index 2 out of bounds for length 2
                                        	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:100)
                                        	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:106)
                                        	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:302)
                                        	at java.base/java.util.Objects.checkIndex(Objects.java:385)
                                        	at java.base/java.util.ArrayList.get(ArrayList.java:427)
                                        	at jadx.core.codegen.InsnGen.makeInlinedLambdaMethod(InsnGen.java:909)
                                        	at jadx.core.codegen.InsnGen.makeInvokeLambda(InsnGen.java:814)
                                        	at jadx.core.codegen.InsnGen.makeInvoke(InsnGen.java:756)
                                        	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:397)
                                        	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:141)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:120)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                        	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:976)
                                        	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:711)
                                        	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:393)
                                        	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:141)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:120)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                        	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:976)
                                        	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:711)
                                        	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:393)
                                        	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:141)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:120)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                        	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:976)
                                        	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:711)
                                        	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:393)
                                        	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:141)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:120)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                        	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:976)
                                        	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:711)
                                        	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:393)
                                        	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:141)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:120)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                        	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:976)
                                        	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:711)
                                        	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:393)
                                        	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:141)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:120)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                        	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:320)
                                        	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:141)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:120)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                        	at jadx.core.codegen.InsnGen.generateMethodArguments(InsnGen.java:976)
                                        	at jadx.core.codegen.InsnGen.makeConstructor(InsnGen.java:711)
                                        	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:393)
                                        	at jadx.core.codegen.InsnGen.addWrappedArg(InsnGen.java:141)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:120)
                                        	at jadx.core.codegen.InsnGen.addArg(InsnGen.java:104)
                                        	at jadx.core.codegen.InsnGen.makeInsnBody(InsnGen.java:343)
                                        	at jadx.core.codegen.InsnGen.makeInsn(InsnGen.java:278)
                                        	... 35 more
                                        */
                                    /*
                                    // Method dump skipped, instructions count: 5169
                                    */
                                    throw new UnsupportedOperationException("Method not decompiled: com.corona.game.DrawPokemonMenu.SelectedMenu.getAction(com.corona.Game, java.lang.String, com.corona.game.Menu):com.corona.game.Action");
                                }

                                @Override // com.corona.game.Action
                                public String getCamera() {
                                    return "gui";
                                }

                                @Override // com.corona.game.Action
                                public Action.Layer getLayer() {
                                    return this.layer;
                                }

                                @Override // com.corona.game.Action
                                public void firstStep(Game game) {
                                    if (this.isStorageChest) {
                                        if (DrawPokemonMenu.allPokemon == game.player.pokemon) {
                                            this.words.add("STORE");
                                        } else {
                                            this.words.add("TAKE");
                                        }
                                        this.words.add("RELEASE");
                                        this.words.add("NICKNAME");
                                        this.words.add("STATS");
                                    } else {
                                        ArrayList<String> fieldMoves = new ArrayList<>(this.pokemon.hms);
                                        fieldMoves.remove("FLASH");
                                        fieldMoves.add("FOLLOW");
                                        if (game.battle.drawAction == null) {
                                            Iterator<String> it = fieldMoves.iterator();
                                            while (it.hasNext()) {
                                                this.words.add(it.next());
                                            }
                                            this.words.add("STATS");
                                        }
                                    }
                                    this.words.add("SWITCH");
                                    if (game.battle.drawAction == null && !this.isStorageChest) {
                                        this.words.add("DROP");
                                    }
                                    this.words.add("CANCEL");
                                    for (int i = 0; i < this.words.size(); i++) {
                                        this.getCoords.put(Integer.valueOf(i), new Vector2(57.0f, (float) (-7 + (16 * (this.words.size() - i)))));
                                    }
                                    this.newPos = this.getCoords.get(0);
                                    this.arrow.setPosition(this.newPos.x, this.newPos.y);
                                    this.curr = 0;
                                }

                                @Override // com.corona.game.Action
                                public void step(Game game) {
                                    if (this.prevMenu != null) {
                                        this.prevMenu.step(game);
                                    }
                                    if (this.textboxDelay < 1) {
                                        this.textboxDelay++;
                                        return;
                                    }
                                    if (InputProcessor.upJustPressed) {
                                        if (this.curr > 0) {
                                            this.curr--;
                                            this.newPos = this.getCoords.get(Integer.valueOf(this.curr));
                                        }
                                    } else if (InputProcessor.downJustPressed && this.curr < this.words.size() - 1) {
                                        this.curr++;
                                        this.newPos = this.getCoords.get(Integer.valueOf(this.curr));
                                    }
                                    for (int i = 0; i < this.words.size(); i++) {
                                        if (i == 0) {
                                            game.uiBatch.draw(this.textBoxTop, 48.0f, (float) (38 + (16 * (this.words.size() - 3))));
                                        } else if (i == this.words.size() - 1) {
                                            game.uiBatch.draw(this.textBoxBottom, 48.0f, 0.0f);
                                        } else {
                                            game.uiBatch.draw(this.textBoxMiddle, 48.0f, (float) (23 + (16 * ((this.words.size() - i) - 2))));
                                        }
                                        String word = this.words.get(i);
                                        for (int j = 0; j < word.length(); j++) {
                                            game.uiBatch.draw(game.textDict.get(Character.valueOf(word.charAt(j))), (float) (64 + (8 * j)), (float) (40 - (16 * ((i - this.words.size()) + 3))));
                                        }
                                    }
                                    game.uiBatch.draw(this.arrow, this.newPos.x, this.newPos.y);
                                    if (InputProcessor.aJustPressed) {
                                        String word2 = this.words.get(this.curr);
                                        if ("CANCEL".equals(word2)) {
                                            DrawPokemonMenu.avatarAnimCounter = 24;
                                            DrawPokemonMenu.avatarHopAnimCounter = 0;
                                            DrawPokemonMenu.avatarAnimCounterGen2 = 0;
                                            DrawPokemonMenu.avatarYellowHealthAnimCounter = 0;
                                            DrawPokemonMenu.avatarRedHealthAnimCounter = 0;
                                            game.insertAction(new PlayMusic("click1", (Action) null));
                                            game.actionStack.remove(this);
                                            if (game.battle.drawAction != null || this.isStorageChest) {
                                                this.prevMenu.disabled = false;
                                                game.insertAction(this.prevMenu);
                                                return;
                                            }
                                            game.insertAction(new Outro(this.prevMenu.prevMenu));
                                            return;
                                        }
                                        Action action = getAction(game, word2, this.prevMenu);
                                        game.actionStack.remove(this);
                                        game.insertAction(action);
                                    } else if (InputProcessor.bJustPressed) {
                                        game.insertAction(new PlayMusic("click1", (Action) null));
                                        DrawPokemonMenu.avatarAnimCounter = 24;
                                        DrawPokemonMenu.avatarHopAnimCounter = 0;
                                        DrawPokemonMenu.avatarAnimCounterGen2 = 0;
                                        DrawPokemonMenu.avatarYellowHealthAnimCounter = 0;
                                        DrawPokemonMenu.avatarRedHealthAnimCounter = 0;
                                        game.actionStack.remove(this);
                                        game.insertAction(new Outro(this.prevMenu));
                                    }
                                }

                                /* compiled from: Menu.java */
                                /* loaded from: pokewilds.jar:com/pkmngen/game/DrawPokemonMenu$SelectedMenu$ExitAfterActions.class */
                                public static class ExitAfterActions extends Menu {
                                    public Action.Layer layer = Action.Layer.gui_106;
                                    boolean firstStep = true;

                                    public ExitAfterActions(Menu prevMenu, Action nextAction) {
                                        this.prevMenu = prevMenu;
                                        this.nextAction = nextAction;
                                    }

                                    @Override // com.corona.game.Action
                                    public String getCamera() {
                                        return "gui";
                                    }

                                    @Override // com.corona.game.Action
                                    public Action.Layer getLayer() {
                                        return this.layer;
                                    }

                                    @Override // com.corona.game.Action
                                    public void step(Game game) {
                                        if (this.firstStep) {
                                            game.insertAction(this.nextAction);
                                            this.firstStep = false;
                                        }
                                        if (this.prevMenu != null) {
                                            this.prevMenu.step(game);
                                        }
                                        Action action = this.nextAction;
                                        while (action != null && !game.actionStack.contains(action)) {
                                            action = action.nextAction;
                                        }
                                        if (action == null) {
                                            DrawPokemonMenu.lastIndex = this.prevMenu.currIndex;
                                            DrawPokemonMenu.lastIndex = this.prevMenu.currIndex;
                                            game.actionStack.remove(this);
                                            game.insertAction(new Outro((Menu) null));
                                            game.insertAction(new WaitFrames(game, 30, new SetField(game, "playerCanMove", true, null)));
                                        }
                                    }
                                }

                                /* compiled from: Menu.java */
                                /* loaded from: pokewilds.jar:com/pkmngen/game/DrawPokemonMenu$SelectedMenu$Outro.class */
                                static class Outro extends Action {
                                    Menu prevMenu;
                                    public Action.Layer layer = Action.Layer.gui_110;
                                    int duration = 9;

                                    public Outro(Menu prevMenu) {
                                        super(new Object[0]);
                                        this.prevMenu = prevMenu;
                                    }

                                    @Override // com.corona.game.Action
                                    public String getCamera() {
                                        return "gui";
                                    }

                                    @Override // com.corona.game.Action
                                    public Action.Layer getLayer() {
                                        return this.layer;
                                    }

                                    @Override // com.corona.game.Action
                                    public void step(Game game) {
                                        this.prevMenu.drawArrowWhite = false;
                                        if (this.prevMenu != null) {
                                            this.prevMenu.step(game);
                                        }
                                        this.duration--;
                                        if (this.duration == 6) {
                                            DrawPokemonMenu.drawChoosePokemonText = false;
                                        } else if (this.duration == 3) {
                                            DrawPokemonMenu.drawChoosePokemonText = true;
                                        } else if (this.duration <= 0) {
                                            game.insertAction(this.prevMenu);
                                            this.prevMenu.disabled = false;
                                            game.actionStack.remove(this);
                                        }
                                    }
                                }

                                /* compiled from: Menu.java */
                                /* loaded from: pokewilds.jar:com/pkmngen/game/DrawPokemonMenu$SelectedMenu$Switch.class */
                                public static class Switch extends Menu {
                                    int curr;
                                    int scrollIndex;
                                    int startPosition;
                                    Vector2 newPos;
                                    public static int index = -1;
                                    public Action.Layer layer = Action.Layer.gui_105;
                                    int timer = 0;
                                    public int upTimer = 0;
                                    public int downTimer = 0;
                                    Sprite arrow = new Sprite(TextureCache.get(Gdx.files.internal("battle/arrow_right1.png")), 0, 0, 5, 7);
                                    Map<Integer, Vector2> arrowCoords = new HashMap();

                                    public Switch(Menu prevMenu) {
                                        this.prevMenu = prevMenu;
                                        for (int i = 0; i < 6; i++) {
                                            this.arrowCoords.put(Integer.valueOf(i), new Vector2(1.0f, (float) (128 - (16 * i))));
                                        }
                                        this.scrollIndex = DrawPokemonMenu.scrollIndex;
                                        this.curr = DrawPokemonMenu.currIndex;
                                        this.startPosition = this.scrollIndex + this.curr;
                                        this.newPos = this.arrowCoords.get(Integer.valueOf(this.curr));
                                        this.arrow.setPosition(this.newPos.x, this.newPos.y);
                                        index = this.curr;
                                    }

                                    @Override // com.corona.game.Action
                                    public String getCamera() {
                                        return "gui";
                                    }

                                    @Override // com.corona.game.Action
                                    public Action.Layer getLayer() {
                                        return this.layer;
                                    }

                                    @Override // com.corona.game.Action
                                    public void step(Game game) {
                                        if (this.prevMenu != null) {
                                            this.prevMenu.step(game);
                                        }
                                        this.arrow.setPosition(this.newPos.x, this.newPos.y);
                                        game.uiBatch.draw(this.arrow, this.arrow.getX(), this.arrow.getY());
                                        if (!this.disabled) {
                                            if (this.timer < 10) {
                                                this.timer++;
                                            }
                                            DrawPokemonMenu.avatarAnimCounter--;
                                            if (DrawPokemonMenu.avatarAnimCounter <= 0) {
                                                DrawPokemonMenu.avatarAnimCounter = 11;
                                            }
                                            if (this.timer == 2) {
                                                DrawPokemonMenu.drawChoosePokemonText = false;
                                            } else if (this.timer > 4) {
                                                if (DrawPokemonMenu.generation == Pokemon.Generation.RED) {
                                                    char[] textArray = "Move POKéMON".toCharArray();
                                                    for (int j = 0; j < textArray.length; j++) {
                                                        game.uiBatch.draw(game.textDict.get(Character.valueOf(textArray[j])), (float) (8 + (8 * j)), 24.0f);
                                                    }
                                                    char[] textArray2 = "where?".toCharArray();
                                                    for (int j2 = 0; j2 < textArray2.length; j2++) {
                                                        game.uiBatch.draw(game.textDict.get(Character.valueOf(textArray2[j2])), (float) (8 + (8 * j2)), 8.0f);
                                                    }
                                                } else {
                                                    char[] textArray3 = "Move to where?".toCharArray();
                                                    for (int j3 = 0; j3 < textArray3.length; j3++) {
                                                        game.uiBatch.draw(game.textDict.get(Character.valueOf(textArray3[j3])), (float) (8 + (8 * j3)), 8.0f);
                                                    }
                                                }
                                            }
                                            if (this.timer > 8) {
                                                if (InputProcessor.upJustPressed || this.upTimer >= 20) {
                                                    if (this.curr + this.scrollIndex > 0) {
                                                        if (this.curr > 0) {
                                                            this.curr--;
                                                            DrawPokemonMenu.currIndex = this.curr;
                                                            this.newPos = this.arrowCoords.get(Integer.valueOf(this.curr));
                                                        } else {
                                                            this.scrollIndex--;
                                                        }
                                                    }
                                                } else if ((InputProcessor.downJustPressed || this.downTimer >= 20) && this.curr + this.scrollIndex < DrawPokemonMenu.allPokemon.size() - 1) {
                                                    if (this.curr < 5) {
                                                        this.curr++;
                                                        DrawPokemonMenu.currIndex = this.curr;
                                                        this.newPos = this.arrowCoords.get(Integer.valueOf(this.curr));
                                                    } else {
                                                        this.scrollIndex++;
                                                    }
                                                }
                                                if (InputProcessor.upPressed) {
                                                    if (this.upTimer < 20) {
                                                        this.upTimer++;
                                                    }
                                                } else if (!InputProcessor.downPressed) {
                                                    this.upTimer = 0;
                                                    this.downTimer = 0;
                                                } else if (this.downTimer < 20) {
                                                    this.downTimer++;
                                                }
                                                if (InputProcessor.aJustPressed) {
                                                    Pokemon movePokemon = DrawPokemonMenu.allPokemon.get(this.startPosition);
                                                    Pokemon movePokemon2 = DrawPokemonMenu.allPokemon.get(this.curr + this.scrollIndex);
                                                    DrawPokemonMenu.allPokemon.remove(this.startPosition);
                                                    DrawPokemonMenu.allPokemon.add(this.startPosition, movePokemon2);
                                                    DrawPokemonMenu.allPokemon.remove(this.curr + this.scrollIndex);
                                                    DrawPokemonMenu.allPokemon.add(this.curr + this.scrollIndex, movePokemon);
                                                    if (DrawPokemonMenu.allPokemon == game.player.pokemon) {
                                                        if (this.startPosition == 0) {
                                                            game.player.currPokemon = movePokemon2;
                                                        }
                                                        if (this.curr == 0) {
                                                            game.player.currPokemon = movePokemon;
                                                        }
                                                    }
                                                    this.disabled = true;
                                                    game.insertAction(new PlayMusic("click1", (Action) null));
                                                    index = -1;
                                                    DrawPokemonMenu.avatarAnimCounter = 24;
                                                    game.actionStack.remove(this);
                                                    game.insertAction(new Outro(this));
                                                    if (game.type == Game.Type.CLIENT) {
                                                        game.client.sendTCP(new Network.UseHM(game.player.network.id, this.startPosition, "SWITCH", this.curr));
                                                    }
                                                } else if (InputProcessor.bJustPressed) {
                                                    this.disabled = true;
                                                    game.insertAction(new PlayMusic("click1", (Action) null));
                                                    index = -1;
                                                    DrawPokemonMenu.avatarAnimCounter = 24;
                                                    game.actionStack.remove(this);
                                                    game.insertAction(new Outro(this));
                                                }
                                            }
                                        }
                                    }

                                    /* compiled from: Menu.java */
                                    /* loaded from: pokewilds.jar:com/pkmngen/game/DrawPokemonMenu$SelectedMenu$Switch$Outro.class */
                                    static class Outro extends Menu {
                                        public Action.Layer layer = Action.Layer.gui_110;
                                        int timer = 0;

                                        public Outro(Menu prevMenu) {
                                            this.prevMenu = prevMenu;
                                        }

                                        @Override // com.corona.game.Action
                                        public String getCamera() {
                                            return "gui";
                                        }

                                        @Override // com.corona.game.Action
                                        public Action.Layer getLayer() {
                                            return this.layer;
                                        }

                                        @Override // com.corona.game.Action
                                        public void step(Game game) {
                                            if (this.prevMenu != null) {
                                                this.prevMenu.step(game);
                                            }
                                            this.timer++;
                                            if (this.timer == 1) {
                                                this.prevMenu = this.prevMenu.prevMenu;
                                                this.prevMenu.drawArrowWhite = false;
                                            } else if (this.timer == 3) {
                                                DrawPokemonMenu.drawChoosePokemonText = true;
                                            } else if (this.timer >= 7) {
                                                DrawPokemonMenu.avatarAnimCounter = 25;
                                                game.actionStack.remove(this);
                                                game.insertAction(this.prevMenu);
                                                this.prevMenu.disabled = false;
                                            }
                                        }
                                    }
                                }
                            }
                        }
